Skip Ribbon Commands
Skip to main content

Creating and maintaining document templates in ContactsLaw

About document templates

Document templates in ContactsLaw are a powerful construct which automate and standardise the process of creating new documents. They build on the power of traditional document templates (as used in Microsoft Word, Outlook, etc), adding the ability to insert data from ContactsLaw (information from files, contacts and other documents). They can be likened to mail merge documents, where the bulk of the document is standardised and key pieces of information are ‘slotted-in’ to personalise each document that is built from the template.

This article covers the following formats:

• Microsoft Word documents (.dot / .dotx / .dotm format)
• Microsoft Outlook messages (.oft format)
• Microsoft Excel workbook (.xlt / .xltx / .xltm format)


New templates

The process for creating a new template depends on your starting point:
  • If you have an existing document that you would like to adapt into the ContactsLaw template, you will need to save it in the correct template format (see above) before importing it into the document template editor.
  • If you want to start from scratch using a blank document, you can use the "New" command on the ribbon in the template editor.
You must then describe the template, select a document type and workgroup as well as any other options that may govern the type of information you can include.
 
Once you have reached this point, you can begin adding placeholder fields ("merge fields") to the document and mapping these onto the actual data from ContactsLaw that you want to insert when documents are built from the template. This process is made substantially easier through the use of the ContactsLaw add-ins for Word, Outlook and Excel.
 
​Tip: If you are creating a document or letter that is similar to one that already exists, you can use the "Export" button in the template editor which will save the fields and mapping in that template. When you save the file to your PC, you will see that you will have two files; one will be a 'dotx/oft/xltx' file and the other 'cl-tmap'. This means that you have saved the original document and all of the mappings between the fields - do not delete the 'cl-tmap' file as this has crucial information stored in it. You can then change the name of the document and make the changes you require. When you import the document as a new template you will need to 'reload' the fields. Depending on how you change the document you will see that some fields may disappear and there may be new fields that need to be mapped.


Editing templates

Begin by authoring the body of the document, i.e. all standardised text and formatting that you want to appear on documents that are subsequently created from this template. If you are working from an existing document, be sure to remove any text that you want to prevent from showing up on the final documents (be particularly cautious of leaving personal or sensitive information in templates).
 
Whenever you encounter a section of the document that needs to come from ContactsLaw (i.e. from a file, contact, the practice or from another document), you will need to insert a special placeholder field:
  1. Position the caret where you want to insert the field, then click the Insert Field button on the ContactsLaw tab of the ribbon.

    WordRibbonInsertField.png

  2. Enter a name for the field. Field names should not contains spaces or symbol characters. Try to use clear, unambiguous names (e.g. 'ContactNameInformal' conveys more than 'PersonName').

  3. You will see the placeholder in the document, displayed as the name you chose above and delimited by double angle brackets, e.g. «ContactFirstName». You will notice that if you click the field once, its background colour will change to dark grey.
​Tip: You can re-use field names; if a field with the same name appears later in the document, ContactsLaw will insert the same value into it. This can be useful as you only need to map the field once in order to have its value appear many times within the document.

Microsoft Word specific

  • As an alternative to text-based placeholder fields, you can also use Form Fields. To insert a Form Field, enable the "Developer" tab in Microsoft Word and select the type of form field (e.g. checkbox, etc) that you want to insert. Remember to assign a name to the field.
Microsoft Outlook specific
  • Fields can only be placed in the body of the message; however, ContactsLaw will automatically create entries in the mapping table that can be used to determine what populates the From, To, CC, BCC and Subject fields.

Microsoft Excel specific

  • A field takes up an entire cell; you cannot place multiple fields within a single cell.
  • ContactsLaw assumes by default that all values inserted into the document will be text. To ensure that numbers, dollar amounts and dates are handled correctly, be sure to change the format of the cell from "General" to a more specific type


Mapping placeholders to ContactsLaw data

Once you have determined where in the document you want to insert data from ContactsLaw, you will need to tell the template editor where you would like the data to come from. You can do this in one of 3 main ways according to your preference:
  • As you go, performing the mapping for each field after you insert it
  • All at once, once you have finished inserting all fields
  • As a separate process altogether, once you have closed Word/Outlook/Excel

For the first 2 approaches above, you establish the mapping by selecting the field (placing the caret inside the field) and clicking the "Field" command on the "Mappings" section of the ribbon. You then select the data you want to map onto the field using the pop-up window that appears.

Alternatively, for the 3rd approach above, you simply drag-and-drop the data from the left-hand pane onto the entry for the field in the right-hand pane.

​Tip: You can create more complex mappings by using either the "Table" command or by adding formatting rules. Refer to the main article for more information about composite mappings and formatting rules.


Final steps

Use the "Save & Check In" command on the ribbon when you are finished editing the template. This will return you to the template editor in ContactsLaw. From there, you can review the mappings and template properties before saving your changes.